package com.mqb;

public enum MsgType {

    LOGIN("1"),
    LOGOUT("2"),

    REQUEST("5"),
    ACK("6"),
    NOTIFY("7"),
    DELIVER("8");


    MsgType(String code) {
        this.code = code;
    }

    private String code;

    public String getCode() {
        return code;
    }

    public static boolean isLogin(String code) {
        return LOGIN.code.equals(code);
    }

    public static boolean isRequest(String code) {
        return REQUEST.code.equals(code);
    }

    public static boolean isAck(String code) {
        return ACK.code.equals(code);
    }

    public static boolean isNotify(String code) {
        return NOTIFY.code.equals(code);
    }

    public static boolean isDeliver(String code) {
        return DELIVER.code.equals(code);
    }
}
